using System;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// HTTP消息收发相关的数据模型
/// </summary>
namespace HttpModels
{
    /// <summary>
    /// 登录请求数据模型
    /// </summary>
    [Serializable]
    public class LoginRequest
    {
        public string username;
        public string password;
        public string deviceId;
        public string platform;

        public LoginRequest(string username, string password, string deviceId, string platform)
        {
            this.username = username;
            this.password = password;
            this.deviceId = deviceId;
            this.platform = platform;
        }
    }

    /// <summary>
    /// 登录响应数据模型
    /// </summary>
    [Serializable]
    public class LoginResponse
    {
        public int code;
        public string message;
        public PlayerInfo playerInfo;
        public string token;

        public LoginResponse()
        {
            playerInfo = new PlayerInfo();
        }
    }

    /// <summary>
    /// 玩家信息数据模型
    /// </summary>
    [Serializable]
    public class PlayerInfo
    {
        public long playerId;
        public string nickname;
        public int level;
        public long exp;
        public long gold;
        public long diamond;
        public List<ItemInfo> items;
        public List<HeroInfo> heroes;

        public PlayerInfo()
        {
            items = new List<ItemInfo>();
            heroes = new List<HeroInfo>();
        }
    }

    /// <summary>
    /// 道具信息数据模型
    /// </summary>
    [Serializable]
    public class ItemInfo
    {
        public int itemId;
        public int count;
    }

    /// <summary>
    /// 英雄信息数据模型
    /// </summary>
    [Serializable]
    public class HeroInfo
    {
        public int heroId;
        public int level;
        public int star;
    }

    /// <summary>
    /// 通用响应数据模型
    /// </summary>
    [Serializable]
    public class BaseResponse
    {
        public int code;
        public string message;
    }
}